package com.bw.Mapper;

import com.bw.doman.sugarDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface sugarMapper {
    @Select("SELECT p.name,sum(final_total_amount) sum FROM order_info o\n" +
            "LEFT JOIN base_province p on o.province_id=p.id\n" +
            "GROUP BY p.name ORDER BY sum")
    List<sugarDTO> getChinaMpa();


    @Select("SELECT t.tm_name,sum(o.final_total_amount) value FROM order_info o\n" +
            "LEFT JOIN order_detail d on o.id=d.order_id\n" +
            "LEFT JOIN sku_info s on s.id=d.sku_id\n" +
            "LEFT JOIN base_trademark t on s.tm_id=t.tm_id\n" +
            "GROUP BY t.tm_name")
    List<sugarDTO> getTrademark();


    @Select("")
    List<sugarDTO> getCategory();
}
